package com.umeox.watch.audiobooks.db

import androidx.room.*
import com.umeox.watch.audiobooks.adapter.HotStoriesAdapter

/**
 * Created by Rambo 2021/8/18
 * Describe:
 */
@Dao
interface AllStoryDao {

    @Query("SELECT * FROM all_story")
    fun loadAll(): List<AllStory>

    @Query("SELECT * FROM all_story WHERE id =:id")
    fun queryById(id: Long): AllStory?

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun save(recommendStory: AllStory)

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun save(recommendStories: List<AllStory>)

    @Delete
    fun delete(recommendStory: AllStory): Int

    @Delete
    fun delete(recommendStories: List<AllStory>)

    @Query("DELETE FROM all_story")
    fun deleteAll(): Int
}